using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using Tongiao.Config;     
using Tongiao.Entity;
namespace Tongiao.ManagerBase
{
                

     public abstract class Tg_CategoryManagerBase
    {
        public Tg_CategoryManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity Insert(Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity Update(Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.Update(obj);             
        }
 
 
        public Tg_CategoryEntity Delete(Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.Delete(obj);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CatName duoc set trong object
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByCatName (Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"CatName");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CatName 
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByCatName (string CatName )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CatName = CatName;  
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"CatName");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByCatType (Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"CatType");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CatType 
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByCatType (string CatType )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CatType = CatType;  
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"CatType");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByCreatedBy (Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"CreatedBy");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CreatedBy 
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByCreatedBy (string CreatedBy )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CreatedBy = CreatedBy;  
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"CreatedBy");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByCreatedDate (Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"CreatedDate");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CreatedDate 
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByCreatedDate (DateTime CreatedDate )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CreatedDate = CreatedDate;  
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"CreatedDate");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteById (Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id 
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteById (Guid Id )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.Id = Id;  
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByOrderIndex (Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"OrderIndex");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien OrderIndex 
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByOrderIndex (int OrderIndex )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.OrderIndex = OrderIndex;  
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"OrderIndex");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Parent duoc set trong object
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByParent (Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"Parent");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Parent 
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByParent (Guid Parent )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.Parent = Parent;  
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"Parent");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByUpdatedBy (Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"UpdatedBy");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien UpdatedBy 
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByUpdatedBy (string UpdatedBy )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.UpdatedBy = UpdatedBy;  
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"UpdatedBy");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByUpdatedDate (Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"UpdatedDate");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien UpdatedDate 
        /// </summary>
        /// <returns>Tg_CategoryEntity</returns>
        public Tg_CategoryEntity DeleteByUpdatedDate (DateTime UpdatedDate )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.UpdatedDate = UpdatedDate;  
            return (Tg_CategoryEntity)Adapter.DeleteByField(obj,"UpdatedDate");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public Tg_CategoryEntity Select(Tg_CategoryEntity obj)
        { 
            return (Tg_CategoryEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(Tg_CategoryEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(Tg_CategoryEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new Tg_CategoryEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new Tg_CategoryEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<Tg_CategoryEntity> SelectAllLST()
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new Tg_CategoryEntity()),new Tg_CategoryEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<Tg_CategoryEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new Tg_CategoryEntity(),option),new Tg_CategoryEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatName (Tg_CategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"CatName");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatName (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"CatName",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatName duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByCatNameLST (Tg_CategoryEntity obj)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CatName"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatName duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByCatNameLST (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"CatName",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatName 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatName (string CatName )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CatName = CatName;  
            return Adapter.SelectByField(obj,"CatName");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatName (string CatName, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CatName = CatName;  
            return Adapter.SelectByField(obj,"CatName",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatName 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByCatNameLST (string CatName )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CatName = CatName;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CatName"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByCatNameLST (string CatName, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CatName = CatName;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CatName",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatType (Tg_CategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"CatType");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatType (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"CatType",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByCatTypeLST (Tg_CategoryEntity obj)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CatType"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByCatTypeLST (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"CatType",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatType (string CatType )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CatType = CatType;  
            return Adapter.SelectByField(obj,"CatType");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatType (string CatType, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CatType = CatType;  
            return Adapter.SelectByField(obj,"CatType",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByCatTypeLST (string CatType )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CatType = CatType;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CatType"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByCatTypeLST (string CatType, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CatType = CatType;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CatType",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedBy (Tg_CategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"CreatedBy");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedBy (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"CreatedBy",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByCreatedByLST (Tg_CategoryEntity obj)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedBy"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByCreatedByLST (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"CreatedBy",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedBy (string CreatedBy )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CreatedBy = CreatedBy;  
            return Adapter.SelectByField(obj,"CreatedBy");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedBy (string CreatedBy, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CreatedBy = CreatedBy;  
            return Adapter.SelectByField(obj,"CreatedBy",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByCreatedByLST (string CreatedBy )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CreatedBy = CreatedBy;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedBy"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByCreatedByLST (string CreatedBy, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CreatedBy = CreatedBy;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedBy",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedDate (Tg_CategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"CreatedDate");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedDate (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"CreatedDate",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByCreatedDateLST (Tg_CategoryEntity obj)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedDate"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByCreatedDateLST (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"CreatedDate",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedDate (DateTime CreatedDate )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CreatedDate = CreatedDate;  
            return Adapter.SelectByField(obj,"CreatedDate");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCreatedDate (DateTime CreatedDate, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CreatedDate = CreatedDate;  
            return Adapter.SelectByField(obj,"CreatedDate",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByCreatedDateLST (DateTime CreatedDate )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CreatedDate = CreatedDate;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedDate"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CreatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByCreatedDateLST (DateTime CreatedDate, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.CreatedDate = CreatedDate;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CreatedDate",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Tg_CategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByIdLST (Tg_CategoryEntity obj)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByIdLST (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Id",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Guid Id )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Guid Id, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByIdLST (Guid Id )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.Id = Id;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByIdLST (Guid Id, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.Id = Id;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByOrderIndex (Tg_CategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"OrderIndex");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByOrderIndex (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"OrderIndex",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByOrderIndexLST (Tg_CategoryEntity obj)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"OrderIndex"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByOrderIndexLST (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"OrderIndex",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByOrderIndex (int OrderIndex )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.OrderIndex = OrderIndex;  
            return Adapter.SelectByField(obj,"OrderIndex");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByOrderIndex (int OrderIndex, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.OrderIndex = OrderIndex;  
            return Adapter.SelectByField(obj,"OrderIndex",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByOrderIndexLST (int OrderIndex )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.OrderIndex = OrderIndex;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"OrderIndex"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByOrderIndexLST (int OrderIndex, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.OrderIndex = OrderIndex;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"OrderIndex",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Parent duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByParent (Tg_CategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"Parent");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Parent duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByParent (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Parent",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Parent duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByParentLST (Tg_CategoryEntity obj)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Parent"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Parent duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByParentLST (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Parent",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Parent 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByParent (Guid Parent )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.Parent = Parent;  
            return Adapter.SelectByField(obj,"Parent");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Parent duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByParent (Guid Parent, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.Parent = Parent;  
            return Adapter.SelectByField(obj,"Parent",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Parent 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByParentLST (Guid Parent )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.Parent = Parent;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Parent"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Parent duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByParentLST (Guid Parent, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.Parent = Parent;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Parent",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedBy (Tg_CategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"UpdatedBy");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedBy (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"UpdatedBy",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByUpdatedByLST (Tg_CategoryEntity obj)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedBy"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByUpdatedByLST (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"UpdatedBy",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedBy (string UpdatedBy )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.UpdatedBy = UpdatedBy;  
            return Adapter.SelectByField(obj,"UpdatedBy");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedBy (string UpdatedBy, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.UpdatedBy = UpdatedBy;  
            return Adapter.SelectByField(obj,"UpdatedBy",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByUpdatedByLST (string UpdatedBy )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.UpdatedBy = UpdatedBy;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedBy"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedBy duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByUpdatedByLST (string UpdatedBy, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.UpdatedBy = UpdatedBy;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedBy",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedDate (Tg_CategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"UpdatedDate");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedDate (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"UpdatedDate",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByUpdatedDateLST (Tg_CategoryEntity obj)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedDate"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectByUpdatedDateLST (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"UpdatedDate",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedDate (DateTime UpdatedDate )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.UpdatedDate = UpdatedDate;  
            return Adapter.SelectByField(obj,"UpdatedDate");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByUpdatedDate (DateTime UpdatedDate, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.UpdatedDate = UpdatedDate;  
            return Adapter.SelectByField(obj,"UpdatedDate",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByUpdatedDateLST (DateTime UpdatedDate )
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.UpdatedDate = UpdatedDate;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedDate"),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien UpdatedDate duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<Tg_CategoryEntity> SelectByUpdatedDateLST (DateTime UpdatedDate, SelectOptions option)
        { 
            Tg_CategoryEntity obj = new Tg_CategoryEntity();
            obj.UpdatedDate = UpdatedDate;  
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"UpdatedDate",option),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectWithConditionLST (Tg_CategoryEntity obj)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new Tg_CategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<Tg_CategoryEntity></returns>
        public List<Tg_CategoryEntity> SelectWithConditionLST (Tg_CategoryEntity obj,SelectOptions option)
        { 
            return  (List<Tg_CategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new Tg_CategoryEntity());
        }

}
}
